package cn.gp.mapper;

import cn.gp.entity.Flower;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * @ClassName FlowerMapper
 * @Description TODO
 * @Author He_Guoping
 * @Date 2023/5/28 17:27
 * @Version 1.0
 */
@Mapper
public interface FlowerMapper {

//    @Select("select * from flower")
    List<Flower> list(
            @Param("name") String name,
            @Param("status") Integer status,
            @Param("categOne") List<Integer> categOne,
            @Param("lowPrice") BigDecimal lowPrice,
            @Param("upperPrice") BigDecimal upperPrice);

    @Insert("insert into flower(name, img, price, status, categ_one) values(#{name}, #{img}, #{price}, #{status}, #{categOne})")
    void save(Flower flower);


    void update(Flower flower);

    @Delete("delete from flower where id = #{id}")
    void deleteById(Integer id);

}
